package com.woniuxy.controller;

import com.woniuxy.anno.RateLimit;
import com.woniuxy.entity.InHospital;
import com.woniuxy.entity.dto.InHospitalDTO;
import com.woniuxy.service.InHospitalService;
import com.woniuxy.util.PageParam;
import com.woniuxy.util.ResponseData;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/inhospital")
public class InHospitalController {
    @Autowired
    InHospitalService inHospitalService;
    //添加住院表
    @PostMapping("/addhz")
    public ResponseData addHz(@RequestBody InHospitalDTO inHospitalDTO){
        return inHospitalService.addHz(inHospitalDTO);
    }
//    @RateLimit(time = 1,maxCount = 0)
    @PostMapping("queryHz")
    public ResponseData<?> queryHz(@RequestBody PageParam<InHospitalDTO> pageParam){
        return inHospitalService.queryInHospitals(pageParam);
    }
}
